<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>modbus_tk.hooks</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            ><a class="navbar" target="_top" href="http://code.google.com/p/modbus-tk/">Modbus Test Kit</a></th>
          </tr></table></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        <a href="modbus_tk-module.html">Package&nbsp;modbus_tk</a> ::
        Module&nbsp;hooks
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
        <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
    onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
        <tr><td align="right"><span class="options"
            >[<a href="frames.html" target="_top">frames</a
            >]&nbsp;|&nbsp;<a href="modbus_tk.hooks-module.html"
            target="_top">no&nbsp;frames</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<!-- ==================== MODULE DESCRIPTION ==================== -->
<h1 class="epydoc">Module hooks</h1><p class="nomargin-top"><span class="codelink"><a href="modbus_tk.hooks-pysrc.html">source&nbsp;code</a></span></p>
<p>Modbus TestKit: Implementation of Modbus protocol in python</p>
  <p>(C)2009 - Luc Jean - luc.jean@gmail.com (C)2009 - Apidev - 
  http://www.apidev.fr</p>
  <p>This is distributed under GNU LGPL license, see license.txt</p>

<!-- ==================== FUNCTIONS ==================== -->
<a name="section-Functions"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Functions</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-Functions"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="modbus_tk.hooks-module.html#install_hook" class="summary-sig-name">install_hook</a>(<span class="summary-sig-arg">name</span>,
        <span class="summary-sig-arg">fct</span>)</span><br />
      Install one of the following hook</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="modbus_tk.hooks-pysrc.html#install_hook">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="uninstall_hook"></a><span class="summary-sig-name">uninstall_hook</span>(<span class="summary-sig-arg">name</span>,
        <span class="summary-sig-arg">fct</span>=<span class="summary-sig-default">None</span>)</span><br />
      remove the function from the hooks</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="modbus_tk.hooks-pysrc.html#uninstall_hook">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="call_hooks"></a><span class="summary-sig-name">call_hooks</span>(<span class="summary-sig-arg">name</span>,
        <span class="summary-sig-arg">args</span>)</span><br />
      call the function associated with the hook and pass the given args</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="modbus_tk.hooks-pysrc.html#call_hooks">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
</table>
<!-- ==================== VARIABLES ==================== -->
<a name="section-Variables"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Variables</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-Variables"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
<tr class="private">
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="_lock"></a><span class="summary-name">_lock</span> = <code title="&lt;_RLock owner=None count=0&gt;">&lt;_RLock owner=None count=0&gt;</code>
    </td>
  </tr>
<tr class="private">
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="_hooks"></a><span class="summary-name">_hooks</span> = <code title="{}"><code class="variable-group">{</code><code class="variable-group">}</code></code>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="__package__"></a><span class="summary-name">__package__</span> = <code title="'modbus_tk'"><code class="variable-quote">'</code><code class="variable-string">modbus_tk</code><code class="variable-quote">'</code></code>
    </td>
  </tr>
</table>
<!-- ==================== FUNCTION DETAILS ==================== -->
<a name="section-FunctionDetails"></a>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Function Details</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-FunctionDetails"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
</table>
<a name="install_hook"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">install_hook</span>(<span class="sig-arg">name</span>,
        <span class="sig-arg">fct</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="modbus_tk.hooks-pysrc.html#install_hook">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Install one of the following hook</p>
  <p>modbus_rtu.RtuMaster.before_open((master,)) 
  modbus_rtu.RtuMaster.after_close((master,) 
  modbus_rtu.RtuMaster.before_send((master, request)) returns modified 
  request or None modbus_rtu.RtuMaster.after_recv((master, response)) 
  returns modified response or None</p>
  <p>modbus_rtu.RtuServer.before_close((server, )) 
  modbus_rtu.RtuServer.after_close((server, )) 
  modbus_rtu.RtuServer.before_open((server, )) 
  modbus_rtu.RtuServer.after_open(((server, )) 
  modbus_rtu.RtuServer.after_read((server, request)) returns modified 
  request or None modbus_rtu.RtuServer.before_write((server, response))  
  returns modified response or None modbus_rtu.RtuServer.on_error((server, 
  excpt))</p>
  <p>modbus_tcp.TcpMaster.before_connect((master, )) 
  modbus_tcp.TcpMaster.after_connect((master, )) 
  modbus_tcp.TcpMaster.before_close((master, )) 
  modbus_tcp.TcpMaster.after_close((master, )) 
  modbus_tcp.TcpMaster.before_send((master, request)) 
  modbus_tcp.TcpMaster.after_recv((master, response))</p>
  <p>modbus_tcp.TcpServer.on_connect((server, client, address)) 
  modbus_tcp.TcpServer.on_disconnect((server, sock)) 
  modbus_tcp.TcpServer.after_recv((server, sock, request)) returns modified
  request or None modbus_tcp.TcpServer.before_send((server, sock, 
  response)) returns modified response or None 
  modbus_tcp.TcpServer.on_error((server, sock, excpt))</p>
  <p>modbus.Master.before_send((master, request)) returns modified request 
  or None modbus.Master.after_send((master)) 
  modbus.Master.after_recv((master, response)) returns modified response or
  None</p>
  <p>modbus.Slave.handle_request((slave, request_pdu)) returns modified 
  response or None modbus.Slave.on_handle_broadcast((slave, response_pdu)) 
  returns modified response or None modbus.Slave.on_exception((slave, 
  function_code, excpt))</p>
  <p>modbus.Databank.on_error((db, excpt, request_pdu))</p>
  <p>modbus.Server.before_handle_request((server, request)) returns 
  modified request or None modbus.Server.after_handle_request((server, 
  response)) returns modified response or None</p>
  <dl class="fields">
  </dl>
</td></tr></table>
</div>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            ><a class="navbar" target="_top" href="http://code.google.com/p/modbus-tk/">Modbus Test Kit</a></th>
          </tr></table></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0.1 on Wed May 26 17:43:06 2010
    </td>
    <td align="right" class="footer">
      <a target="mainFrame" href="http://epydoc.sourceforge.net"
        >http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie();
  // -->
</script>
</body>
</html>
